how a spark application runs